import React, { Component } from "react";
import { connect } from "react-redux";
import {
  increment,
  incrementAsync,
} from "../../redux/action/count";
class Count extends Component {
  render() {
    return (
      <div>
        <h2>当前的count之和为{this.props.count}下方人数为{this.props.persons.length}</h2>
        <button onClick={()=>{this.props.increment(1)}}>Add</button>
        <button onClick={()=>{this.props.incrementAsync(1)}}>AddAsync</button>
      </div>
    );
  }
}
export default connect((state) => ({ count: state.count,persons:state.persons}), {
  increment,
  incrementAsync,
})(Count);
